d = {
    [-1] = function()
        -- 关闭
        system.closeFlashlight()
    end,
    [1] = function()
        -- 打开
        system.openFlashlight()
    end
}
s = d[runtime.commandType]
if (s) then
    s()
end

-- 或者
type = runtime.commandType
if (type == 1) then
    system.openFlashlight()
elseif (type == -1) then
    system.closeFlashlight()
end
